import {
    getAllClassify
} from '../../api/index'
Page({
    data: {
        loading: true,
        activeTab: 0,
        tabList: [],
    },
    onLoad: function (options) {
        getAllClassify().then(res => {
            const tabList = res.data
            this.setData({
                tabList,
                loading: false
            })
        })
    },

    onChangeTabs(e) {
        const activeTab = e.detail.activeKey
        this.setData({
            activeTab
        })
    },

    goSearch(e) {
        let classifyName = e.currentTarget.dataset.value;
        wx.navigateTo({
            url: '/pages/SearchList/index?flag=ALL&classifyName=' + classifyName,
        })
    },
})